<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of lien_he_model
 *
 * @author QuangBV
 */
class lienhe_m extends MY_Model {

    //put your code here
    function __construct() {
        parent::__construct();
        $this->table_name = "client_info";
        header('Content-Type: text/html; charset=utf-8');
    }

    function add($client_name, $client_address = NULL, $client_phone = NULL, $client_email = NULL, $client_content = NULL) {
        $this->db->set("client_name", $client_name);
        $this->db->set("client_phone", $client_phone);
        $this->db->set("client_email", $client_email);
        $this->db->set("client_address", $client_address);
        $this->db->set("client_content", $client_content);
        $this->db->set("create_time",date('Y-m-d H:i:s'));
        $this->db->set("update_time",date('Y-m-d H:i:s'));
        $this->db->insert($this->table_name);
        if ($this->db->affected_rows() != 0) {
            return true;
        } else {
            return false;
        }
    }

    public function update($client_id, $params = null) {
        parent::update(array('client_id' => $client_id), $params);
    }

}

?>
